using System.Collections.Generic;
using System.Drawing;
using Microsoft.SqlServer.Types;
using SinBiota.Model.Business.MapServices.Datatypes;

namespace SinBiota.Model.Business.MapServices.Interfaces
{
    public interface ISpatialServices
    {
        /// <summary>
        /// Converts a point from latitude/longitude WGS-84 coordinates (in degrees)
        /// into pixel XY coordinates at a specified level of detail.
        /// </summary>
        /// <param name="latitude">Latitude of the point, in degrees.</param>
        /// <param name="longitude">Longitude of the point, in degrees.</param>
        /// <param name="levelOfDetail">Level of detail, from 1 (lowest detail)
        /// to 23 (highest detail).</param>
        /// <param name="tileImageSize">Size of the tile image (usually 256 pixels)</param>
        Point LatLongToPixel(double latitude, double longitude, int levelOfDetail, int tileImageSize);

        /// <summary>
        /// Converts a QuadKey into tile XY coordinates.
        /// </summary>
        /// <param name="quadKey">QuadKey of the tile.</param>
        Point QuadKeyToTileXY(string quadKey);

        /// <summary>
        /// Converts tile XY coordinates into latitude/longitude WGS-84 coordinates (in degrees).
        /// </summary>
        /// <param name="tileX">Tile X coordinate</param>
        /// <param name="tileY">Tile Y coordinate</param>
        /// <param name="zoom">Zoom level</param>
        LatLong TileXYToLatLong(int tileX, int tileY, int zoom);

        IList<SqlGeography> GetGeometriesInsideQuadkey(IList<SqlGeography> geographyList, string quadkey);
        IList<SqlGeography> GetGeometriesIntersectionQuadkey(IList<SqlGeography> geographyList, string quadkey);
    }
}